/*
    **********************************************
    定义redis部分，利用redis做热点缓存
    **********************************************
*/

#ifndef HTTPSERVERREDIS
#define HTTPSERVERREDIS

#include "HTTPRelated.h"

class Redis {

private:
    redisContext* _connect;
    redisReply* _reply;
    std::string host; 
    int port;  

public:
    // 只能显示的去定义Redis
    explicit Redis(std::string h = "127.0.0.1", int p = 6379);
    ~Redis();
    Redis(Redis& r) = delete;
    Redis(Redis&& r) = delete;
    Redis& operator=(Redis& r) = delete;
    Redis& operator=(Redis&& r) = delete;
    void connect();
    std::string getValue(const std::string& key);
    void set(std::string key, std::string value);
};



#endif